package com.lyx.question.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author 14667
 * @date 2022/7/25 17:15
 */
@Data
@TableName("paper")
public class Paper {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 用户id
     */
    private Integer userId;
    /**
     * 第二章节名字
     */
    private String  chapterTwoName;
    /**
     * 第三章节名字
     */
    private String chapterThreeName;
    /**
     * 试卷总分
     */
    private Double totalScore;
    /**
     * 用户得分
     */
    private Double userScore = 0d;
    /**
     * 题目数量
     */
    private Integer questionNum;
    /**
     * 完成状态
     */
    private Integer finishStatus = 0;
    /**
     * 试卷总时间
     */
    private Integer totalTime;
    /**
     * 答对题目数量
     */
    private Integer correctNum = 0;
    /**
     * 提交时间
     */
    private LocalDateTime commitTime;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateTime;
}
